<?php


namespace app\admin\controller;

use app\BaseController;
use app\model\Category as CategoryModel;
class Category extends BaseController
{

    public function index()
    {
        return $this->success(CategoryModel::order('id','desc')->select());
    }


    public function create()
    {

        return $this->success(CategoryModel::create(request()->param()));
    }


    public function edit($id)
    {
        return $this->success(CategoryModel::where('id',$id)->update(request()->param()));
    }


    public function delete($id)
    {
        return $this->success(CategoryModel::where('id',$id)->delete());
    }



}